CC=mpicc.openmpi
MPIRUN=mpirun.openmpi

CFLAGS=-Wall -g -O3
LDLIBS=-lm
SOURCE=life_mpi.c
OBJ=$(SOURCE:.c=.o)
PROGS=life_mpi
N=17

all: $(PROGS)

run: $(PROGS)
	$(MPIRUN) -H infini1,infini2,infini3,infini4 -np $N --mca btl openib,sm,self --mca btl_openib_warn_default_gid_prefix 0 --mca orte_base_help_aggregate 0 ./life_mpi 1024

$(PROGS): $(OBJ)
	$(CC) $(CFLAGS) $^ -o $@ $(LDLIBS)

clean:
	rm -f $(OBJ) $(EXEC)
